import request from '@/utils/request'

/**
* @description: 获取部门列表
*
*/
export function getDepartments() {
  return request.get('/company/department')
}

/**
* @description: 删除部门
* @param {string} id 删除的部门id
*/
export function delDepartments(id) {
  return request.delete(`/company/department/${id}`)
}

/**
* @description: 新增部门
* @param {object} data 新增部门信息
*/
export function addDepartments(data) {
  return request.post('/company/department', data)
}

/**
* @description:获取-部门详情
* @param {string} id  获取的部门 id
*/
export function getDepartDetail(id) {
  return request.get(`/company/department/${id}`)
}

/**
* @description:修改-部门详情
* @param {Objetc} data 修改后的数据
*/
export function updateDepartments(data) {
  return request.put(`/company/department/${data.id}`, data)
}
